import { Component } from '@angular/core';

import { Hero2 } from './hero2';

@Component({
  selector: 'hero-form',
  templateUrl: './hero-form.component.html'
})

export class HeroFormComponent {
  powers = ['Really Smart', 'Super Flexible',
            'Super Hot', 'Weather Changer'];

  model = new Hero2(18, 'Dr IQ', this.powers[0], 'Chuck Overstreet');

  submitted = false;

  onSubmit(){
    this.submitted = true;
  }

  newHero() {
    this.model = new Hero2(42, '', '');
  }

  get diagnostic() {
    return JSON.stringify(this.model);
  }
}
